package com.aptech.domain.JPA;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Post entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "POST", schema = "dbo", catalog = "Blue_Pumpkin")
public class Post implements java.io.Serializable {

	// Fields

	private Integer postId;
	private Account account;
	private Topic topic;
	private String postSubject;
	private String postContent;
	private Timestamp postTime;
	private Integer postOrder;

	// Constructors

	/** default constructor */
	public Post() {
	}

	/** minimal constructor */
	public Post(Integer postId, Topic topic) {
		this.postId = postId;
		this.topic = topic;
	}

	/** full constructor */
	public Post(Integer postId, Account account, Topic topic,
			String postSubject, String postContent, Timestamp postTime,
			Integer postOrder) {
		this.postId = postId;
		this.account = account;
		this.topic = topic;
		this.postSubject = postSubject;
		this.postContent = postContent;
		this.postTime = postTime;
		this.postOrder = postOrder;
	}

	// Property accessors
	@Id
	@Column(name = "POST_ID", unique = true, nullable = false)
        @GeneratedValue(strategy=GenerationType.IDENTITY)
	public Integer getPostId() {
		return this.postId;
	}

	public void setPostId(Integer postId) {
		this.postId = postId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ACCOUNT_ID")
	public Account getAccount() {
		return this.account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TOPIC_ID", nullable = false)
	public Topic getTopic() {
		return this.topic;
	}

	public void setTopic(Topic topic) {
		this.topic = topic;
	}

	@Column(name = "POST_SUBJECT", length = 200)
	public String getPostSubject() {
		return this.postSubject;
	}

	public void setPostSubject(String postSubject) {
		this.postSubject = postSubject;
	}

	@Column(name = "POST_CONTENT", length = 1073741823)
	public String getPostContent() {
		return this.postContent;
	}

	public void setPostContent(String postContent) {
		this.postContent = postContent;
	}

	@Column(name = "POST_TIME", length = 23)
	public Timestamp getPostTime() {
		return this.postTime;
	}

	public void setPostTime(Timestamp postTime) {
		this.postTime = postTime;
	}

	@Column(name = "POST_ORDER")
	public Integer getPostOrder() {
		return this.postOrder;
	}

	public void setPostOrder(Integer postOrder) {
		this.postOrder = postOrder;
	}

}